package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.PlatformTeachingMapper;
import com.ruoyi.teaching.domain.PlatformTeaching;
import com.ruoyi.teaching.service.IPlatformTeachingService;

/**
 * 名师视频Service业务层处理
 *
 * @author ruoyi
 * @date 2021-12-07
 */
@Service
public class PlatformTeachingServiceImpl implements IPlatformTeachingService
{
    @Autowired
    private PlatformTeachingMapper platformTeachingMapper;

    /**
     * 查询名师视频
     *
     * @param id 名师视频主键
     * @return 名师视频
     */
    @Override
    public PlatformTeaching selectPlatformTeachingById(Long id)
    {
        return platformTeachingMapper.selectPlatformTeachingById(id);
    }

    /**
     * 查询名师视频列表
     *
     * @param platformTeaching 名师视频
     * @return 名师视频
     */
    @Override
    public List<PlatformTeaching> selectPlatformTeachingList(PlatformTeaching platformTeaching)
    {
        return platformTeachingMapper.selectPlatformTeachingList(platformTeaching);
    }

    /**
     * 新增名师视频
     *
     * @param platformTeaching 名师视频
     * @return 结果
     */
    @Override
    public int insertPlatformTeaching(PlatformTeaching platformTeaching)
    {
        platformTeaching.setCreateTime(DateUtils.getNowDate());
        return platformTeachingMapper.insertPlatformTeaching(platformTeaching);
    }

    /**
     * 修改名师视频
     *
     * @param platformTeaching 名师视频
     * @return 结果
     */
    @Override
    public int updatePlatformTeaching(PlatformTeaching platformTeaching)
    {
        platformTeaching.setUpdateTime(DateUtils.getNowDate());
        return platformTeachingMapper.updatePlatformTeaching(platformTeaching);
    }

    /**
     * 批量删除名师视频
     *
     * @param ids 需要删除的名师视频主键
     * @return 结果
     */
    @Override
    public int deletePlatformTeachingByIds(Long[] ids)
    {
        return platformTeachingMapper.deletePlatformTeachingByIds(ids);
    }


    /**
     * 批量逻辑删除名师视频
     *
     * @param ids 需要删除的名师视频主键
     * @return 结果
     */
    @Override
    public int logicDeletePlatformTeaching(Long[] ids,String delType,Long delUser)
    {
        return platformTeachingMapper.logicDeletePlatformTeaching(ids,delType,delUser);
    }

    /**
     * 删除名师视频信息
     *
     * @param id 名师视频主键
     * @return 结果
     */
    @Override
    public int deletePlatformTeachingById(Long id)
    {
        return platformTeachingMapper.deletePlatformTeachingById(id);
    }
}
